﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace Converter
{
    public class DateToLongDateStringConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo cultureInfo)
        {
            if (value != null)
            {
                DateTime dateTime = (DateTime)value;
                if(BusinessConfiguration.Configuration.CultureInfo == "vi")
                    return dateTime.ToString("dd/MM/yyyy");
                return dateTime.ToString("MM/dd/yyyy");
            }
            return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo cultureInfo)
        {
                return value;

        }
    } 
}
